package exam.web.action.base;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

import exam.model.dao.QuestionExamDAO;
import exam.model.entity.TQuestionExamEntity;

/**
 * <p>QuestionActionBase</p>
 * 
 * @author PhongTN
 * @version 02/05/2012
 */

public class QuestionExaminationActionBase extends ActionSupport 
		implements ModelDriven<TQuestionExamEntity>, ServletRequestAware, ServletResponseAware {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 1L;

	// tQuestionExamEntity
	protected TQuestionExamEntity tQuestionExamEntity = new TQuestionExamEntity();
	
	// questionDAO
	protected QuestionExamDAO questionExamDAO = new QuestionExamDAO();
	
	// request
	protected HttpServletRequest request;
	
	// response
	protected HttpServletResponse response;
	
	@Override
	public TQuestionExamEntity getModel() {
		// TODO Auto-generated method stub
		return tQuestionExamEntity;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		// TODO Auto-generated method stub
		this.response = response;
	}

	@Override
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request = request;
	}

	// Get/Set tQuestionExamEntity
	public TQuestionExamEntity gettQuestionExamEntity() {
		return tQuestionExamEntity;
	}

	public void settQuestionExamEntity(TQuestionExamEntity tQuestionExamEntity) {
		this.tQuestionExamEntity = tQuestionExamEntity;
	}

}
